#include<iostream>
#include<algorithm>

using namespace std;
const int N=20;
int cats[N],weight[N];
int ret=20;
int n,k;
void dfs(int num,int m)
{
	if(num>=ret)	return;

	if(m>n)
	{
		ret=min(ret,num);
		return;
	}

	for(int i=1;i<=num;i++)
	{
		if(cats[m]+weight[i]<=k)
		{
			weight[i]+=cats[m];
			dfs(num,m+1);
			weight[i]-=cats[m];
		}
	}

	weight[num+1]=cats[m];
	dfs(num+1,m+1);
	weight[num+1]=0;
}

int main()
{
	cin>>n>>k;
	for(int i=1;i<=n;i++)
	{
		cin>>cats[i];
	}
	sort(cats+1,cats+1+n,[](int a,int b)
	{
		return a>b;
	});
	dfs(0,1);
	cout<<ret<<endl;
}